package userInterface;

import java.awt.Dimension;

import javax.swing.JFrame;

import baseObject.IBrickBreaker;
import controler.IControler;

@SuppressWarnings("serial")
public class MainWindow extends JFrame{
	public BrickBreakerPanel brickBreakerPanel;
	private IControler controler;
	
	public void setControler(IControler controler){
		this.controler = controler;
		this.brickBreakerPanel = new BrickBreakerPanel();
	}
	
	public void initComponent(){
		this.setTitle("BrickBreaker");
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setPreferredSize(new Dimension(IBrickBreaker.XMAX,  IBrickBreaker.YMAX));
		this.add(brickBreakerPanel);
		this.pack();
		this.setVisible(true);
		this.addKeyListener(this.controler);
	}

	
	public BrickBreakerPanel getPanel(){
		return this.brickBreakerPanel;
	}
}
